import { request } from "../../request/index.js";
Page({

    /**
     * 页面的初始数据
     */
    data: {
        cart: {},
        token: ''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        const token = wx.getStorageSync("token");
        this.setData({
            token,
        });
        let orderSn = options.orderSn;
        this.showDetail(orderSn);
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    async showDetail(orderSn) {
        const result = await request({
            url: "/order/order/app/" + orderSn + "/detail",
            method: "GET",
            header: { "token": this.data.token }
        });

        this.setData({
            cart:result.data
        });
    }

})